package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.CoreIndicatorsRuleDao;
import cn.topevery.garden.entity.po.CoreIndicatorsItem;
import cn.topevery.garden.entity.po.CoreIndicatorsRule;
import cn.topevery.garden.entity.query.CoreIndicatorsRuleQuery;
import cn.topevery.garden.entity.vo.CoreIndicatorsRuleVO;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 
 *
 * @author code-generate
 * @date 2022-01-05
 */
@Service
public class CoreIndicatorsRuleLogic extends BaseLogic<CoreIndicatorsRule> {
    @Autowired
    CoreIndicatorsRuleDao coreIndicatorsRuleDao;

    @Override
    public BaseEntityDao<CoreIndicatorsRule, Integer> getDao() {
        return coreIndicatorsRuleDao;
    }



    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<CoreIndicatorsRuleVO> listPage(CoreIndicatorsRuleQuery query) {
        return coreIndicatorsRuleDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        coreIndicatorsRuleDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param coreIndicatorsRule 实体
     */
    public void saveOrUpdate(String userId, CoreIndicatorsRule coreIndicatorsRule){
        coreIndicatorsRuleDao.saveOrUpdate(userId,coreIndicatorsRule);
    }

    /**
         * 根据自定义列值来获取对象
         */
    public CoreIndicatorsRule getEntityByColumn(String key, String value) {
        return coreIndicatorsRuleDao.getEntityByColumn(key, value);
    }

    public List<CoreIndicatorsRule> rules(String code){
        return  coreIndicatorsRuleDao.rules(code);
    };

    public List<CoreIndicatorsItem> info(String code) {
        return coreIndicatorsRuleDao.info(code);
    };

    public List<Map<String, Object>> infoData(String code,String mapId) {
        return coreIndicatorsRuleDao.infoData(code, mapId);
    };

    public List<Map<String, Object>> infoDataShow(String code,String mapId) {
        return coreIndicatorsRuleDao.infoDataShow(code, mapId);
    };

    public List<Map<String, Object>> coreList() {
        return coreIndicatorsRuleDao.coreList();
    };
}
